Powerline and ZSH’s Agnoster theme in VS Code

Today I was installing Oh My ZSH and the theme Agnoster and it worked in the the normal terminal but not in Visual Studio Code’s terminal, as it needs a monospaced font and Powerline isn’t one.

In this post I’ll explain how to quickly fix it.

The problem

Problem

Problem

VS Code defaults the terminal’s font to the editor’s font, and since the Agnoster theme needs Powerline, the terminal outputs non-sense characters.

Prerequisites

  • Zsh installed, obviously…
  • VS Code, obviously…

Installing a monospaced version of Powerline

After searching for a bit, I found Menlo for Powerline, a Menlo font patched to work with the font Agnoster needs. Since Menlo is monospaced, jackpot!

Clone the github repository

git clone https://github.com/abertsch/Menlo-for-Powerline.git

Move the font to the fonts folder

sudo mv "Menlo for Powerline.ttf" /usr/share/fonts/

Refresh the fonts cache

sudo fc-cache -vf /usr/share/fonts/

Setting the font in VS Code

Go to your UI Settings: CTRL + SHIFT + P > UI Settings

VS Code - UI Settings

VS Code - UI Settings

Search for Terminal Font and set the new font:

VS Code - UI Settings

VS Code - UI Settings

As you can see in the terminal, the new font gets applied and everything works as expected.

Zanid Haytam Written by:

Zanid Haytam is an enthusiastic programmer that enjoys coding, reading code, hunting bugs and writing blog posts.

comments powered by Disqus